<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('正式服务商列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <input type="hidden" name="belongAgent" th:value="${belongAgent}">
                        <ul>
                            <li>
                                服务商编号：
                                <input type="text" name="agentNum"/>
                            </li>
                            <li>
                                服务商名称：
                                <input type="text" name="agentName"/>
                            </li>
                            <li>
                                 靓号：
                                <input type="text" name="beautiful"/>
                            </li>
                            <li>
                                靓号名称：
                                <input type="text" name="beautifulName"/>
                            </li>
                            <li>
                                服务商状态：
                                <select name="agentStatus">
                                    <option value="0">正常</option>
                                    <option value="5">服务商注销</option>
                                    <option value="6">已禁用</option>
                                </select>
                            </li>
                            <li class="select-time" style="margin-left: 11px">
                                <label>创建时间： </label>
                                <input type="text" class="time-input"  placeholder="开始时间" name="begin_valid"/>
                                <span>-</span>
                                <input type="text" class="time-input"  placeholder="结束时间" name="end_valid"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"  class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var datas = [[${@dict.getType('agent_status')}]];
        var editFlag = [[${@permission.hasPermi('agentInfo:agentInfo:edit')}]];
        var prefix = ctx + "agentInfo/agentInfo";

        $(function() {
            var options = {
                url: prefix + "/agentListAll",
                modalName: "服务商申请",
                clickToSelect:true,
                columns: [{
                    radio: true
                },
                {
                    field: 'agentNum',
                    title: '服务商编号'
                },
                {
                    field: 'agentName',
                    title: '服务商名称'
                },
                {
                    field: 'beautiful',
                    title: '靓号'
                },
                {
                    field: 'beautifulName',
                    title: '靓号名称'
                },
                {
                    field: 'addName',
                    title: '添加人',
                    formatter:function (value, row, index) {
                        return $.table.tooltip(value,5);
                    }
                },
                {
                    field: 'localdate',
                    title: '添加日期',
                    formatter:function (value, row, index) {
                        return $.table.tooltip(value,10);
                    }
                },
                {
                    field: 'note',
                    title: '备注',
                    formatter:function (value, row, index) {
                        return $.table.tooltip(value,5);
                    }
                },
                {
                    field: 'agentNature',
                    title: '数据来源',
                    visible: false
                }]
            };
            $.table.init(options);
        });
        function submitHandler(index, layero) {
            var rows = $.table.selectFirstColumns();
            if (rows.length == 0) {
                $.modal.alertWarning("请选择一条记录");
                return;
            }
            $.modal.close();
            // 父页面的变量

            parent.$('#beforePurchaser').val($.table.selectColumns("agentNum"));
            parent.$('#beforAgent').val($.table.selectColumns("agentNum") +"-"+ $.table.selectColumns("agentName"));
        }

    </script>
</body>
</html>